home *** CD-ROM | disk | FTP | other *** search
/ GameStar 1998 November (Bonus) / GAMESTAR11B.ISO / ENCYC99 / MM / T620273A.DCR / scripts_4_Class PuzzleGod.ls < prev    next >
Encoding:
Text File  |  1998-07-02  |  1.3 KB  |  73 lines

  1. property numPieces, piecesSolved, oneSolvedSound, allSolvedSound, ResetButton, piecesIn, activePiece
  2.  
  3. on pieceAdded me
  4.   set piecesIn to piecesIn + 1
  5.   turnON(ResetButton)
  6. end
  7.  
  8. on pieceRemoved me
  9.   set piecesIn to piecesIn - 1
  10.   if piecesIn = 0 then
  11.     turnOff(ResetButton)
  12.   end if
  13. end
  14.  
  15. on pieceSolved me
  16.   set piecesSolved to piecesSolved + 1
  17.   if piecesSolved = numPieces then
  18.     allSolvedAction(me)
  19.   else
  20.     rightSound(me)
  21.   end if
  22. end
  23.  
  24. on pieceUnsolved me
  25.   set piecesSolved to piecesSolved - 1
  26. end
  27.  
  28. on newActivePiece me, xPiece
  29.   if objectp(activePiece) then
  30.     unHighlight(activePiece)
  31.   end if
  32.   set activePiece to xPiece
  33.   highlight(activePiece)
  34. end
  35.  
  36. on new me, xInt
  37.   set numPieces to xInt
  38.   set piecesSolved to 0
  39.   return me
  40. end
  41.  
  42. on linkUp me, xButton
  43.   set ResetButton to xButton
  44.   turnOff(ResetButton)
  45. end
  46.  
  47. on allSolvedAction me
  48.   global pieceList, fixedPieceList, infoBox
  49.   rightSound(me)
  50.   repeat with i in pieceList
  51.     destroy(i)
  52.   end repeat
  53.   set pieceList to []
  54.   repeat with i in fixedPieceList
  55.     destroy(i)
  56.   end repeat
  57.   set fixedPieceList to []
  58.   stringEvent(infoBox, "DNA und Mutationen")
  59.   go(label("rewardFrame"))
  60. end
  61.  
  62. on rightSound me
  63.   set the volume of sound 1 to 255
  64.   puppetSound("rightSound")
  65.   updateStage()
  66. end
  67.  
  68. on wrongSound me
  69.   set the volume of sound 1 to 255
  70.   puppetSound("wrongSound")
  71.   updateStage()
  72. end
  73.